/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"5AD8CAE0-DB00-46F3-BB8C-317D73910FA2"}
 */
var buscar_vendedor = "";

/**
 * @type {Boolean}
 *
 * @properties={typeid:35,uuid:"3309D0CB-4164-4286-9CF6-8935956BC695",variableType:-4}
 */
var bok = false;

/**
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A9ED1240-FD1E-463C-AB1B-3A1F73849ABC"}
 */
function btn_alta_vendedor(event) {
		
		var win = application.createWindow(application.getUUID().toString(),JSWindow.MODAL_DIALOG);
		win.resizable = false;
		win.storeBounds = false;
		win.undecorated = false;
		
		forms.VENDEDOR_EDIT.controller.newRecord();
		forms.VENDEDOR_EDIT.elements.btn_baja.visible = false;
		forms.VENDEDOR_EDIT.elements.btn_volver.visible = false;
		forms.VENDEDOR_EDIT.elements.bnt_aceptar.visible = true;
		forms.VENDEDOR_EDIT.elements.btn_cancelar.visible = true;
		win.show(forms.VENDEDOR_EDIT);
		
		
	}

/**
 * @AllowToRunInFind
 * 
 * @param {Object} oldValue
 * @param {Object} newValue
 * @param {Object} event
 *
 * @properties={typeid:24,uuid:"870E25E6-2056-48FA-829A-23B827CFA36A"}
 */
function onDataChange_campo_buscar(oldValue, newValue, event) {

			if (forms.VENDEDOR_lst.foundset.find()){
				
				forms.VENDEDOR_lst.nombre = "#%" + buscar_vendedor + "%";
				forms.VENDEDOR_lst.foundset.search();
				
				
				return true;
			}else
				return false;
				
				
		}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3BA7EB30-C05C-4572-88FB-2F60E68F1D6B"}
 */
function btn_aceptar(event) {
	
	
	controller.getWindow().destroy();
}

/**
 * @properties={typeid:24,uuid:"C3F66069-E4DF-441F-A4BD-35C02AC7837E"}
 */
function btn_cancelar(event) {
	bok = false;
	var win = controller.getWindow();
	win.destroy();
	
}

/**
 * @param {Object} firstShow
 * @param {Object} event
 *
 * @properties={typeid:24,uuid:"2AA98D32-4CBD-4947-B092-69F1A658B6C0"}
 */
function onShow(firstShow, event) {

	buscar_vendedor = ""; 
	bok = false;
}
